import vtk
from vtk.qt4.QVTKRenderWindowInteractor import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from jolly.visual.vtkPythonViewImage2D import *
from jolly.datamanagement.vtkPythonMetaImageData import *
class MainWindow(QMainWindow):
	def __init__(self, parent=None):
	       QMainWindow.__init__(self, parent)
	       self.viewxy = QVTKRenderWindowInteractor(self)
	       self.view1 = vtkPythonViewImage2D()
	       self.view1.SetInput(None)
	       self.view1.GlobalWarningDisplayOff()
	       self.view1.SetupInteractor(self.viewxy)
	       self.view1.SetRenderWindow(self.viewxy.GetRenderWindow())
	       self.view1.SetBackground(0.0, 0.0, 0.0)
	       self.view1.SetSliceOrientationToXY()
	       self.view1.SetSize([300, 300])
	       self.view1.SetInteractorStyleTypeToNavigation()

	       self.Image = vtkPythonMetaImageData()
	       self.Image.ReadSeriesFile("C:/head")
	       self.view1.SetInput(self.Image.getDataSet())
	       self.setCentralWidget(self.viewxy)

if __name__ == "__main__":
   
    app = QApplication([])
    frame = MainWindow()
    frame.show()
    app.exec_()

